package com.qfedu.fmmall.user.service.impl;

import com.qfedu.fmmall.entity.Users;
import com.qfedu.fmmall.user.dao.UsersMapper;
import com.qfedu.fmmall.user.service.UserLoginCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * @author : yanBin
 * @date :2022/1/21 11:07
 */
@Service
public class UserLoginCheckServiceImpl implements UserLoginCheckService {
    @Autowired
    private UsersMapper usersMapper;

    @Override
    public List<Users> getCheck(String username) {
        List<Users> usersList = usersMapper.selectByName(username);
        if (CollectionUtils.isEmpty(usersList)) {
            return null;
        }

        return usersList;
    }
}
